package kr.hkit.PowerJava.chapter06;

import java.util.Scanner;

public class Gcd {
     public static void main(String[] args) {
		int x;
		int y;
		
		System.out.print("두개의 정수를 입력하시오(큰수, 작은수) : ");
	    Scanner input = new Scanner(System.in);
	    
	    x=input.nextInt();
	    y=input.nextInt();
	    
	    calGcd(x,y);
     }

	private static void calGcd(int x, int y) {
		int r=0;
		while(y !=0){
			r = x % y;
			x = y;
			y = r;
		}
		System.out.println("쵀대 공약수는 "+x+ "입니다.");
		
		}
		
	}
     

